<template>
    <div>
        <h1>用户详情</h1>
        <table class="table table-bordered" >
            <thead>
                <tr>
                    <th>用户名</th>
                    <th>密码</th>
                    <th>真实姓名</th>
                    <th>身份证号</th>
                    <th>联系方式</th>
                    <th>出生日期</th>
                    <th>性别</th>
                    <th>年收入</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="item in info" :key="item.U_Id" >
                    <td>{{item.UL_Name}}</td>
                    <td>{{item.UL_Pwd}}</td>
                    <td>{{item.T_Dname}}</td>
                    <td>{{item.T_Dcard}}</td>
                    <td>{{item.T_Dphone}}</td>
                    <td>{{item.T_Ddate}}</td>
                    <td>{{item.T_Dsex}}</td>
                    <td>{{item.T_Dincome}}元</td>
                    <td>
                        <button class="btn btn-primary">修改</button>
                        <button class="btn btn-danger">删除</button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">

import axios from 'axios';
import { ref,onMounted } from 'vue';


const info:any = ref([])

onMounted(()=>{
    getInfo();
})

const getInfo = ()=>{
    axios({

        method:'get',
        url:'http://localhost:57969/api/User/UserShow',

    })
    .then((res)=>{
        info.value = res.data;
    })
    .catch((err)=>{
        console.log(err);
    })
}


</script>